﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using XRM.Security.DataAccess.Interfaces;

namespace XRM.Security.DataAccess.Models
{
    [Table("IdentityCenterCert")]
    public class IdentityCenterCert : ICertificate, ICertStatus
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int IdentityCenterCertId { get; set; }
        
        [Required]
        [MaxLength(255)]
        public string FileName { get; set; }

        public byte[] FileData { get; set; }

        [Required]
        [MaxLength(50)]
        public string SerialNumber { get; set; }

        [Required]
        public DateTime UploadDate { get; set; }
        [Required]
        public DateTime FromDate { get; set; }
        [Required]
        public DateTime ToDate { get; set; }

        [Required]
        [MaxLength(50)]
        public string Thumbprint { get; set; }
        
        public int IdentityCenterId { get; set; }

        [ForeignKey("IdentityCenterId")]
        public virtual IdentityCenter IdentityCenter { get; set; }
    } 
}
